<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input {
            margin-right: 10px;
            color: #999;
            outline: none;
        }

        button {
            width: 60px;
            background-color: rgb(0, 135, 190);
            border: 0;
            color: #fff;

        }
    </style>
</head>

<body>
    <input type="text" value="邮箱/ID/手机号">
    <input type="text" value="密码">
    <input type="text" value="密码">
    <button>登录</button>
    <script>
        var ip = document.querySelectorAll('input')
        for (var i = 0; i < ip.length; i++) {
            ip[i].onfocus = function () {
                if (this.value != '') {
                    this.value = '';
                    this.style.color = '333'
                }
            }
        }
    </script>
</body>

</html>